﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace EventBus.Abstractions
{
    public interface IEventHandlerExecutionContext
    {
        void RegisterHandler(Type eventType, Type handlerType);
        void RegisterHandler<TEvent, TEventHandler>()
            where TEvent : IEvent
           where TEventHandler : IEventHandler<TEvent>;

        bool HandlerRegistered(Type eventType, Type handlerType);
        bool HandlerRegistered<TEvent, TEventHandler>()
            where TEvent : IEvent
           where TEventHandler : IEventHandler<TEvent>;

        Task HandleAsync(IEvent @event);
    }
}
